SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 53059: The DOSUBL and DOSUB functions do not return macro variables from the submitted code

DetailsAboutRate It

The DOSUB and DOSUBL functions enable the immediate execution of SAS® code after a text string is passed. Macro variables that are created or updated during the execution of the submitted code are exported back to the calling environment. When this problem occurs, any macro variables that are created or revised during the execution of submitted code are not being exported back to the calling environment.

The example code below illustrates the problem:

%macro test; %global val; %let val=100; %mend test; data _null_; rc=dosubl('%test'); temp=symget('val'); put temp=; run;

The variable TEMP should contain the value of 100, but it contains a missing value instead.

The following example code circumvents the problem for the code above:

%macro test; %global val; %let val=100; &val %mend test; data _null_; temp=resolve('%test'); put temp=; run;

In this case, the workaround is successful because the macro %TEST contains only macro statements. If the macro contained statements other than macro statements, the RESOLVE function would not work correctly.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASMicrosoft Windows Server 2003 Enterprise Edition9.3 TS1M09.3 TS1M2
Microsoft Windows Server 2003 Datacenter Edition9.3 TS1M09.3 TS1M2
Windows 7 Professional 32 bit9.3 TS1M09.3 TS1M2
Microsoft Windows Server 2003 for x649.3 TS1M09.3 TS1M2
Microsoft Windows Server 20089.3 TS1M09.3 TS1M2
Microsoft Windows Server 2008 R29.3 TS1M09.3 TS1M2
Microsoft Windows Server 2008 for x649.3 TS1M09.3 TS1M2
Microsoft Windows XP Professional9.3 TS1M09.3 TS1M2
Windows 7 Enterprise 32 bit9.3 TS1M09.3 TS1M2
Windows 7 Enterprise x649.3 TS1M09.3 TS1M2
Windows 7 Home Premium 32 bit9.3 TS1M09.3 TS1M2
Windows 7 Home Premium x649.3 TS1M09.3 TS1M2
Microsoft Windows Server 2003 Standard Edition9.3 TS1M09.3 TS1M2
Microsoft® Windows® for x649.3 TS1M09.3 TS1M2
Z649.3 TS1M09.3 TS1M2
z/OS9.3 TS1M09.3 TS1M2
Solaris for x649.3 TS1M09.3 TS1M2
Linux for x649.3 TS1M09.3 TS1M2
Linux9.3 TS1M09.3 TS1M2
64-bit Enabled Solaris9.3 TS1M09.3 TS1M2
HP-UX IPF9.3 TS1M09.3 TS1M2
64-bit Enabled HP-UX9.3 TS1M09.3 TS1M2
64-bit Enabled AIX9.3 TS1M09.3 TS1M2
Windows Vista for x649.3 TS1M09.3 TS1M2
Windows Vista9.3 TS1M09.3 TS1M2
Windows 7 Ultimate x649.3 TS1M09.3 TS1M2
Windows 7 Ultimate 32 bit9.3 TS1M09.3 TS1M2
Windows 7 Professional x649.3 TS1M09.3 TS1M2
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.